﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Prototype.master" AutoEventWireup="false" CodeFile="RecipieDetails.aspx.vb" Inherits="Recipies_RecipieDetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<fieldset>
<legend>Recipie</legend>

    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        DataSourceID="DSRecipies" Height="50px" Width="444px">
        <Fields>
            <asp:BoundField DataField="AuthorPic" HeaderText="AuthorPic" 
                SortExpression="AuthorPic" />
            <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                SortExpression="FirstName" />
            <asp:BoundField DataField="LastName" HeaderText="LastName" 
                SortExpression="LastName" />
            <asp:BoundField DataField="Content" HeaderText="Content" 
                SortExpression="Content" />
            <asp:BoundField DataField="Picture" HeaderText="Picture" 
                SortExpression="Picture" />
            <asp:BoundField DataField="SubmissionDate" HeaderText="SubmissionDate" 
                SortExpression="SubmissionDate" />
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="DSRecipies" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        
        
        SelectCommand="SELECT [AuthorPic], [FirstName], [LastName], [Content], [Picture], [SubmissionDate] FROM [QRecipies] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    </fieldset>
    <br/>
    <fieldset>
    <legend>Comments</legend>
    

    <asp:GridView ID="GridView1" runat="server" DataSourceID="DSComments" 
            AutoGenerateColumns="False" Width="441px">
        <Columns>
            <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
            <asp:BoundField DataField="Author" HeaderText="Author" 
                SortExpression="Author" />
            <asp:BoundField DataField="Comments" HeaderText="Comments" 
                SortExpression="Comments" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="DSComments" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        SelectCommand="SELECT [Comments], [Author], [Title] FROM [tblcomments] WHERE ([Article_fkid] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="ID" Name="Article_fkid" 
                QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>  
    </fieldset>
    <br/>
    <section>
   <fieldset>
    <legend><label for="Details">Details</label></legend>
    <form action="" method="post">
     <ul>
      <li>
        <label for="Title">Title:</label>
        <asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
        </li>
    <li>
        <label for="Author">Author:</label>
        <asp:TextBox ID="txtAuthor" runat="server"></asp:TextBox>
        </li>
                <li>
        <label for="comments">Your Comments:</label>
        <asp:TextBox ID="txtcomments" runat="server" TextMode="MultiLine"></asp:TextBox>
        </li>

        <li>
           <asp:Button ID="btnSubmit" runat="server" Text="Add Comment" />
        </li>
    </ul>
   </form>
    </fieldset>
   

    </section>
</asp:Content>

